package com.jcj.house;

import com.jcj.framework.Music;
import com.jcj.framework.Sound;
import com.jcj.framework.gl.Animation;
import com.jcj.framework.gl.Font;
import com.jcj.framework.gl.Texture;
import com.jcj.framework.gl.TextureRegion;
import com.jcj.framework.impl.GLGame;

public class Assets {
	
	public static Texture inicio;
	public static TextureRegion inicioRegion;
	
    public static Texture background;
    public static TextureRegion backgroundRegion;

    public static Texture items;
    public static TextureRegion hero;
    public static TextureRegion piano;
    public static TextureRegion cactus;
    public static TextureRegion fruta;
    public static TextureRegion enrredadera;
    public static TextureRegion soundOn;
    public static TextureRegion soundOff;
    
    public static Texture gameover;
    public static TextureRegion gameoverRegion;
    
    public static Texture info;
    public static TextureRegion infoRegion;
    
    public static Texture pausa;
    public static TextureRegion pausaRegion;
    
    public static Animation ladron1;
    public static Animation ladron2;
    public static Animation ladron3;
    
    /*
    public static Font font;
    public static Music music;
    public static Sound clickSound;*/

    public static void load(GLGame game) {
    	//se carga pantalla principal
        inicio = new Texture(game, "main.png");
        inicioRegion = new TextureRegion(inicio, 0, 0, 480, 320);
        
        //gameover
        gameover = new Texture(game, "game_over.png");
        gameoverRegion = new TextureRegion(gameover,0,0,480,320);
        
        //info
        
        info = new Texture(game, "info.png");
        infoRegion = new TextureRegion(info,0,0,480,320);
        
        //pausa
        
        pausa = new Texture(game, "pausa.png");
        pausaRegion = new TextureRegion(pausa,0,0,480,320);
        
        
        //fondo del juego
        background = new Texture(game, "background.png");
        backgroundRegion = new TextureRegion(background, 0, 0, 480, 320);
        
        //objetos del juego
        
        items = new Texture(game, "items.png");
        ladron1 = new Animation (0.2f,
				  new TextureRegion(items, 6,54,77,94), //71x40
				  new TextureRegion(items, 87,55, 160,97)); //73x42
        ladron2 = new Animation (0.2f,
				  new TextureRegion(items, 9,100,85,142), //76x42
				  new TextureRegion(items, 88,98, 167,143)); //79x45 
        ladron3 = new Animation (0.2f,
				  new TextureRegion(items, 1,1,80,46),//79x45
				  new TextureRegion(items, 86,1, 161,49));//75x48
        
        //items
        fruta = new TextureRegion(items,4,388,36,46);
        enrredadera = new TextureRegion(items,54,324,43,39);
        cactus = new TextureRegion(items,56,387,35,47);
        piano = new TextureRegion(items,104,348,90,104);
        hero = new TextureRegion(items,3,292,38,72);
        soundOn = new TextureRegion(items,2,10,60,64);
        soundOff= new TextureRegion(items,68,12,60,64);
        
        
        /*font = new Font(items, 224, 0, 16, 16, 20);
        music = game.getAudio().newMusic("music.mp3");
        music.setLooping(true);
        music.setVolume(0.5f);
        if(Settings.soundEnabled)
            music.play();
        jumpSound = game.getAudio().newSound("jump.ogg");*/
       
    }

    public static void reload() {
        background.reload();
        items.reload();
        inicio.reload();
        pausa.reload();
        info.reload();
        //if (Settings.soundEnabled)
          //  music.play();
    }

    public static void playSound(Sound sound) {
        //if (Settings.soundEnabled)
         //   sound.play(1);
    }

}
